<?php /* Smarty version 2.6.26, created on 2013-04-12 03:00:08
         compiled from ../templates/item_index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'U', '../templates/item_index.html', 35, false),)), $this); ?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>コントロールパネル</title>

    <link href="./assets/styles/default.css" rel="stylesheet" />
	<script src="./assets/scripts/libs/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="./assets/scripts/import.js" type="text/javascript"></script>
       		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			$('#btn-export').click(function(){	
				if(confirm('ダウンロードしますか？')){
					document.form1.csv.value="download";
					document.form1.submit();
					
				}
			});
			$('#btn-reset').click(function(){	
				location.href = document.form1.action;
			});
			
			$('#btn_search').click(function(){	
				document.form1.csv.value="";
				document.form1.submit();
			});

			$('#btn_single_c').click(function(){	
				location.href ="<?php echo ((is_array($_tmp='Home/Item/insert')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
";
			});
		});
	
		function toPage(thepage) {
			document.form1.page.value =  thepage;
			document.form1.csv.value="";
			document.form1.submit();
		}

		$(function() {
			categoryModal({url:	"<?php echo ((is_array($_tmp='Home/Category/index')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
?keepThis=true&parent=3&TB_iframe=true&height=500&width=300&modal=false",
				mode:"tree",container:"#selected_category",trigger:"#id_category a",hidden:'category'});
		});
		</script>
</head>
<body>
	
<?php echo $this->_tpl_vars['zhead']; ?>

<div id="container">
<?php echo $this->_tpl_vars['zmenu']; ?>


    <article>
    	<h2><span>&nbsp;</span>商品管理<p><a href="javascript:;">Open Plugins</a></p></h2>
        <nav>
        	<ul>
		     <li class="active"><a href="<?php echo ((is_array($_tmp='Home/Item/index')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
"><span>商品検索</span></a></li>
              <li><a href="<?php echo ((is_array($_tmp='Home/Item/insert')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
"><span>商品登録</span></a></li>
              <li><a href="<?php echo ((is_array($_tmp='Home/Item/rank')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
"><span>ランキング</span></a></li>
              <li><a href="<?php echo ((is_array($_tmp='Home/Item/set')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
"><span>基本設定</span></a></li>
			</ul>
        </nav>

        <section id="content">

        	<h3>商品検索</h3>
			<div id="search_form">
				<form name="fm" id="form1" method="get" action="<?php echo ((is_array($_tmp='Home/item/search')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
">
					<input type="hidden" name="page" />
					<dl>
						<dt>フリーワード</dt>
						<dd>
							<input type="text" name="free_word" value="<?php echo $this->_tpl_vars['forms']['free_word']; ?>
" />
						</dd>
					</dl>
					<dl>
						<dt>状態</dt>
						<dd>
					    <?php $_from = $this->_tpl_vars['goods_status']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['member'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['member']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['kk'] => $this->_tpl_vars['vv']):
        $this->_foreach['member']['iteration']++;
?>
					   		<?php $this->assign('goods_statu', "goods_statu".($this->_tpl_vars['kk'])); ?>
							<label><input type="checkbox" name="goods_statu<?php echo $this->_tpl_vars['kk']; ?>
"  <?php if ($this->_tpl_vars['forms'][$this->_tpl_vars['goods_statu']] == $this->_tpl_vars['kk']): ?> checked="true" <?php endif; ?> value="<?php echo $this->_tpl_vars['kk']; ?>
" /><?php echo $this->_tpl_vars['vv']; ?>
</label>
						<?php endforeach; endif; unset($_from); ?>
						</dd>
					</dl>
					<dl>
						<dt>更新日時</dt>
						<dd>
							<input type="text" name="data1" class="text_date" value="<?php echo $this->_tpl_vars['forms']['data1']; ?>
" /> ～
							<input type="text" name="data2" class="text_date" value="<?php echo $this->_tpl_vars['forms']['data2']; ?>
" />
						</dd>
					</dl>
					<dl class="category clear">
						<dt>カテゴリー</dt>
						<dd>
							<p class="btn_blank float-left btn_category" id="id_category">
                                	<a href="javascript:;">カテゴリ選択</a>
                            </p>
                                 <input type="hidden" name="category" />
                            	<ul id="selected_category" class="float-left">
                                      <?php unset($this->_sections['sec1']);
$this->_sections['sec1']['name'] = 'sec1';
$this->_sections['sec1']['start'] = (int)0;
$this->_sections['sec1']['loop'] = is_array($_loop=$this->_tpl_vars['category_data']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['sec1']['step'] = ((int)1) == 0 ? 1 : (int)1;
$this->_sections['sec1']['show'] = true;
$this->_sections['sec1']['max'] = $this->_sections['sec1']['loop'];
if ($this->_sections['sec1']['start'] < 0)
    $this->_sections['sec1']['start'] = max($this->_sections['sec1']['step'] > 0 ? 0 : -1, $this->_sections['sec1']['loop'] + $this->_sections['sec1']['start']);
else
    $this->_sections['sec1']['start'] = min($this->_sections['sec1']['start'], $this->_sections['sec1']['step'] > 0 ? $this->_sections['sec1']['loop'] : $this->_sections['sec1']['loop']-1);
if ($this->_sections['sec1']['show']) {
    $this->_sections['sec1']['total'] = min(ceil(($this->_sections['sec1']['step'] > 0 ? $this->_sections['sec1']['loop'] - $this->_sections['sec1']['start'] : $this->_sections['sec1']['start']+1)/abs($this->_sections['sec1']['step'])), $this->_sections['sec1']['max']);
    if ($this->_sections['sec1']['total'] == 0)
        $this->_sections['sec1']['show'] = false;
} else
    $this->_sections['sec1']['total'] = 0;
if ($this->_sections['sec1']['show']):

            for ($this->_sections['sec1']['index'] = $this->_sections['sec1']['start'], $this->_sections['sec1']['iteration'] = 1;
                 $this->_sections['sec1']['iteration'] <= $this->_sections['sec1']['total'];
                 $this->_sections['sec1']['index'] += $this->_sections['sec1']['step'], $this->_sections['sec1']['iteration']++):
$this->_sections['sec1']['rownum'] = $this->_sections['sec1']['iteration'];
$this->_sections['sec1']['index_prev'] = $this->_sections['sec1']['index'] - $this->_sections['sec1']['step'];
$this->_sections['sec1']['index_next'] = $this->_sections['sec1']['index'] + $this->_sections['sec1']['step'];
$this->_sections['sec1']['first']      = ($this->_sections['sec1']['iteration'] == 1);
$this->_sections['sec1']['last']       = ($this->_sections['sec1']['iteration'] == $this->_sections['sec1']['total']);
?>
											<li id="<?php echo $this->_tpl_vars['category_data'][$this->_sections['sec1']['index']]['category_cd']; ?>
"><a href="javascript:;" class="delete_category">削除</a> <?php echo $this->_tpl_vars['category_data'][$this->_sections['sec1']['index']]['category_name']; ?>
</li>
                                      <?php endfor; endif; ?>
                                </ul>
						</dd>
					</dl>
					<p class="search_submit">
						<button type="submit" class="submit"><span>検索</span></button>
					</p>
			    <input type="hidden" name="search" value="1" />
				<input type="hidden" name="csv" />
				</form>
			</div>
<?php if (! $this->_tpl_vars['is_showlist']): ?>
			<p class="message"><?php if ($this->_tpl_vars['page']['cnt'] > 0): ?><?php echo $this->_tpl_vars['page']['cnt']; ?>
件登録されています。<?php else: ?>見つかりませんでした。<?php endif; ?></p>

			<ul class="btns b10 l10 float-right">
				<li class="btn single c"><a id ="btn_single_c" href="javascript:;">新規登録</a></li>
			</ul>
			<p class="btn_dl float-right">
				<a id ="btn-export" href="javascript:;">
					CSVダウンロード
				</a>
			</p>

			<table id="search_result" class="sortable">
				<thead>
					<tr>
						<th>コード</th>
						<th width="64">画像</th>
						<th>商品名</th>
						<th>価格</th>
						<th>社内コメント</th>
						<th>登録日時</th>
						<th>更新日時</th>
						<th>参照</th>
						<th>更新</th>
					</tr>
				</thead>
				<tbody>
								<?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['member'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['member']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
        $this->_foreach['member']['iteration']++;
?>
								<tr>
						            <td><?php echo $this->_tpl_vars['v']['goods_id']; ?>
</td>
						            <td class="alig-center"><img src="./images/<?php echo $this->_tpl_vars['v']['goods_image']; ?>
" width="64" height="64" /></td>
						            <td><?php echo $this->_tpl_vars['v']['goods_name']; ?>
</td>
						            <td><?php echo $this->_tpl_vars['v']['goods_unitprice']; ?>
円</td>
						            <td><?php echo $this->_tpl_vars['v']['insideappraise']; ?>
</td>
						            <td><?php echo $this->_tpl_vars['v']['c_time']; ?>
</td>
						            <td><?php echo $this->_tpl_vars['v']['u_time']; ?>
</td>
							        <td class="update"><a href="<?php echo ((is_array($_tmp='Home/Item/refer')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
?id=<?php echo $this->_tpl_vars['v']['id']; ?>
">参照</a></td>
							       <td class="update"><a href="<?php echo ((is_array($_tmp='Home/Item/update')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
?id=<?php echo $this->_tpl_vars['v']['id']; ?>
">更新</a></td>
					             </tr>
								<?php endforeach; endif; unset($_from); ?>	
				</tbody>
			</table>

			<p class="pageNav">
				<?php echo $this->_tpl_vars['pageing']; ?>

			</p>
<?php endif; ?>
        </section>
    </article>

</div>
<?php echo $this->_tpl_vars['zfooter']; ?>

</body>
</html>